package com.phantasy.scene.tile
{
	import flash.geom.Point;

	public class TileUitls
	{
		public static const CORRECT_VALUE:Number = (Math.cos((-(Math.PI) / 6)) * Math.SQRT2);
		
		public function TileUitls()
		{
		}
		
		public static function indexToFlat(_arg1:Pt, _arg2:Number=-1):Point
		{
			if (_arg2 == -1)
			{
				_arg2 = TileConstant.TILE_SIZE;
			};
			var _local3:Number = (_arg1.x - _arg1.z);
			var _local4:Number = ((_arg1.y * CORRECT_VALUE) + ((_arg1.x + _arg1.z) * 0.5));
			return (new Point((_local3 * _arg2), (_local4 * _arg2)));
		}
		
		public static function getIsoIndexMidVertex(_arg1:Pt):Point
		{
			var _local2:Point = indexToFlat(_arg1);
			return (new Point(_local2.x, (_local2.y + (TileConstant.TILE_SIZE / 2))));
		}
	}
}